package hyg.q5;

/**
 * Created by brss on 2018/9/17.
 */
public class Main {

    public static void main(String[] args) {
        int n = 5;//小朋友人数
        System.out.println(getRes(n));
    }
    private static int getRes(int n) {
        if (n == 1 )
            return 0;
        if (n == 2)
            return 1;
        int sum = 1;
        for (int i = n-1 ; i > 0 ; i--) {
            sum*=i;//n的阶乘
        }
        return (sum*(n-1))/2;
    }
}
